import { get, post } from "../http";

export const getTodayIndex = async (jyr: any) =>
  await post(`/api/index/getAllTodayIndex`, jyr);


export const getTodayBk = async ({jyr,pcode}) =>
  await post(`/api/bk/getAllTodayBk`,  {jyr,pcode});

export const getNewJyr = async () =>
  await get(`/api/getNewJyr`);

export const getStockData = async ({ jyr,bkcode,isParent }) =>
  await post(`/api/bk/getBkStockData`, {jyr,bkcode,isParent});


export const getZtbData = async (jyr: any) =>
  await post(`/api/stock/getZtbData`, jyr);

export const insertBkMonitor = async ({ jyr,bkcode,isParent }) =>
  await post(`/api/bk/insertBkMonitor`, { jyr,bkcode,isParent });

export const insertBkZtb = async () =>
  await post(`/api/bk/insertZtb`, {});


export const insertStockMonitor = async ({ jyr,code,bkcode }) =>
  await post(`/api/bk/insertStockMonitor`, { jyr,code,bkcode });

export const getBkStockList = async ({ jyr,bkcode }) =>
  await post(`/api/monitor/getListStock`, { jyr,bkcode });

export const getNewBkList = async ( jyr ) =>
  await post(`/api/stock/getMonitorBks`,  jyr );

export const removeMonitorStock = async ({bkCode,code}) =>
  await post(`/api/stock/removeMonitorStock`, {bkCode,code});

export const updateMonitorStock = async ({jyr,bkcode,code,range,type,nbkcode,lbdesc,remark}) =>
  await post(`/api/stock/updateMonitorStock`, {jyr,bkcode,code,range,type,nbkcode,lbdesc,remark});

export const refreshMonitorStock = async () =>
  await post(`/api/monitor/refreshMonitorStock`, {});

export const addMonitorStock = async ({jyr,bkcode,code,name,range,type,lbdesc,remark}) =>
  await post(`/api/stock/addMonitorStock`, {jyr,bkcode,code,name,range,type,lbdesc,remark});

export const refreshDataNow = async () =>
  await post(`/api/monitor/refreshData`, {});

export const getStockKLines = async (code) =>
  await post(`/api/stock/getStockKLines`, code);

export const getStockFenshi = async (code) =>
  await post(`/api/stock/getStockFenshi`, code);




